## problem 2

# Method: assign each person a number, S= {1:10000}.  Use internal pseudo random number generator to pick a 
# a number from the set difference of S and B (S and not B) and add that number to B.  Have B initialize 
# as an empty set (which is effectively represented below)


size = 40   # sample size
S = 1:10000
B = numeric(size)
n=length(S)


for (i in seq(size))
{
	print (i)
	random_choice = sample(setdiff(S,B),1,prob=rep(1/(n-i+1),(n-i+1)))
	B[i] = random_choice
}
B

# ......or sample(S,size=40,replace=F)